package com.lh.model;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Student实体类
 *
 * 注解：@ConfigurationProperties(prefix = "name")
 *      寻找配置文件中以name开头的自动给下面属性赋值 相当于@Value("${配置中属性名}")
 *
 * @Author LuoHang
 * @Date 2022-05-14 18:48
 **/
@Component(value = "student")
@ConfigurationProperties(prefix = "student")
public class Student {
    private String name;
    private Integer age;
    private String sex;
    private String school;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", school='" + school + '\'' +
                '}';
    }
}
